﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Pixysoft.Framework.Configurations.Core
{
    class XmlProperty : IXmlProperty
    {
        string key;

        string value;

        public XmlProperty(string key, string value)
        {
            if (string.IsNullOrEmpty(key))
                throw new Exception("missing key for property.");
            else
                this.key = key.Trim();

            if (string.IsNullOrEmpty(value))
                this.value = null;
            else
                this.value = value.Trim();
        }

        #region IXmlProperty 成员

        public string Key
        {
            get { return key; }
        }

        public string Value
        {
            get { return value; }
            set { this.value = value; }
        }

        #endregion

        public override string ToString()
        {
            return key;
        }
    }
}
